<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org"
      layout:decorator="layout/m_master">

<div layout:fragment="content">

    <input type="hidden" id="cId" th:value="${cid}"/>
    <div class="page-group">
        <div class="page page_acticle_index">
            <div th:replace="layout/m_layout::title('文章')"></div>
            <div class="page-content infinite-scroll">

                <div class="bcui-btnnav">
                    <a href="/m/article" th:class="${cid eq 0?'item active':'item'}">
                        全部
                    </a>
                    <a class="item " th:each="item:${categoryList}"
                       th:class="${item.id eq cid?'item active':'item '}"
                       th:href="'?cid='+${item.id}" th:text="${item.name}">
                    </a>
                </div>

                <div class="bcui-infinite" pages-src="/m/article" pages-current="1">
                    <div class="bcui-infinite-list  Newslist ActicleList">

                    </div>
                    <div class="bcui-infinite-preloader" status="more">
                        <div class="bcui-flow-more"><font>加载更多</font></div>
                        <div class="bcui-flow-loading"></div>
                        <div class="bcui-flow-end"><font>没有了～</font></div>
                        <div class="bcui-flow-nothing"><font>没有找到相关数据！</font></div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <div th:replace="layout/m_layout::systemJs"></div>

    <script type="text/javascript">
        // 加载最新单身列表
        bottlecms.load({
            done: function (page, next) {
                bottlecms.get("/m/ajax/data/article", {
                    cId: $("#cId").val(),
                    page: page
                }, function (data) {
                    var lis = [];
                    for (var o in data.list) {
                        lis.push(acticle_template(data.list[o]))
                    }
                    next(lis.join(''), lis.length);
                })
            }
        }).init();
    </script>

</div>
</html>
